package guda.house.biz.form;

import guda.house.dal.dataobject.BuildingDO;

import javax.validation.constraints.NotNull;

/**
 * Created by well on 15/11/13.
 */
public class BuildingEditForm extends BuildingForm{

    @NotNull(message = "不能为空")
    private Long buildingId;

    public void initForm(BuildingDO buildingDO){
        setBuildingId(buildingDO.getBuildingId());
        setBuildingUnit(buildingDO.getBuildingUnit());
        setVillageId(buildingDO.getVillageId());
        setBuildingName(buildingDO.getBuildingName());
       // setBuildingTypeId(buildingDO.getBuildingTypeId());
        setFloorCount(buildingDO.getFloorCount());
    }

    public BuildingDO toDO(){
        BuildingDO buildingDO = super.toDO();
        buildingDO.setBuildingId(buildingId);
        return buildingDO;
    }

    public Long getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(Long buildingId) {
        this.buildingId = buildingId;
    }
}
